{% extends 'layout.html' %}
{% load my_tags %}
{% block content %}
    <div>
{#    <form action="" method="get" class="form-inline">#}
{#        {% csrf_token %}#}
{#        <div class="col-lg-6" style="float: right;padding: 0">#}
{#            <div class="input-group">#}
{#                <div class="input-group-btn">#}
{##}
{#                    <select name="condition" id="" class="form-control">#}
{#                        <option value="customer">客户姓名</option>#}
{#                        <option value="status">跟进状态</option>#}
{#                    </select>#}
{##}
{#                </div>#}
{#                <input type="text" name="sou" class="form-control"#}
{#                       aria-label="Text input with segmented button dropdown">#}
{#            </div>#}
{#             <button type="submit" class="btn btn-default">搜索</button>#}
{#        </div>#}
{#    </form>#}
    </div>
    <form action="" method="post" class="form-inline">
        {% csrf_token %}

        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>序号</th>
                <th>客户姓名</th>
                <th>跟进内容</th>
                <th>跟进状态</th>
                <th>跟进人</th>
                <th>跟进日期</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for consul in consul_all %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ consul.customer.name }}</td>
                    <td>{{ consul.note|truncatechars:20 }}</td>
                    <td>{{ consul.get_status_display }}</td>
                    <td>{{ consul.consultant }}</td>
                    <td>{{ consul.date }}</td>

                    <td>
                        <a href="{% reverse_url request 'consul_edit' consul.id %}">
                        <button type="button" class="btn-primary btn ">编辑</button>
                    </a>
                </tr>
            {% endfor %}

            </tbody>
        </table>
        <div style="margin-left: 40%">
            <ul class="pagination"> {{ page_html}}</ul>
        </div>

    </form>

{% endblock %}
